/*
 * article.h
 *
 *  Created on: Jan 31, 2012
 *      Author: mostafa
 */

#ifndef ARTICLE_H_
#define ARTICLE_H_
#include <vector>
#include <string>
#include <map>
#include "pugixml.hpp"
#include "maxent.h"
#include "common.h"
#include "Relation.h"
using namespace std;

class article {
private:
//	extern void splitstr(string text,string delmiter,vector<string>* result);
//	extern string intToString(int x);
//	extern void split(const string& s, char c,vector<string>& v);
	string title;
	vector<Sentence*> abstract;
	int year;
	double score;
	string PumbedID;
	string authors;
	string affilation;
public:
	string testing;

	Sentence get_Sentence_from_cons(pugi::xml_node cons);
	article();
	bool readfromPubmedxml(string Path);
	void writetoXml(string Path);//M7md
	int readfromXml(string Path);//Ramy
	int readrfomXMl(pugi::xml_node article);
	vector<ME_Sample> getFeaturesfomXMl(pugi::xml_node article,vector<ME_Model>vme,vector<ME_Model>vme_chunking);
	Sentence get_Sentence_from_cons(pugi::xml_node cons,Sentence*,vector<int>* begin,vector<int>* end,vector<string>*);
	void tokenizeSentence(string sentence,Sentence*,string ne);
	int downloadpapers(string query,int noPapers,string Outputpath);
	vector<Relation>  getRealtions(ME_Model ContainRelation,ME_Model Classify);
	int writetoREF(string filepath);
	void writetoHTML(string Path);
	void addIOB();
	void NLPProcessing(const vector<ME_Model> & vme, const vector<ME_Model> & chunking_vme,const ME_Model & me);
	vector<Token> getNamed_entities();
    vector<Sentence*> getAbstract() const;
    string getAffilation() const;
    string getAuthors() const;
    string getPumbedId() const;
    double getScore() const;
    string getTitle() const;
    int getYear() const;
    void setAbstract(vector<Sentence*> abstract);
    void setAffilation(string affilation);
    void setAuthors(string authors);
    void setPumbedId(string PumbedID);
    void setScore(double score);
    void setTitle(string title);
    void setYear(int year);
    void PrintAbstract();
    virtual ~article();
};

#endif /* ARTICLE_H_ */
